#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <memory>

using namespace std;

int &foo()
{
    static int x = 10;
    printf("变量x的值为：%d\n", x);
    static int y = 20;
    x = 30;
    printf("变量x的值改变为：%d\n", x);
    printf("A!\n");
    return x;
}

int main(int argc, char *argv[])
{
    int a = 10;
    int &b = a;
    b = 20;
    cout << "a = " << a << endl; // Output: a = 20
    cout << "b = " << b << endl; // Output: b = 20
    printf("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!\n");
    int &c = foo();
    // c = 30;
    cout << "one c = " << c << endl; // Output: c = 30
    foo() = 300;
    cout << "two c = " << c << endl; // Output: c = 300
    printf("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!\n");

    foo() = foo() ;
    cout << "three c = " << c << endl; // Output: c = 300

    return 0;
}